def func():
    print("Hello,我是func函数。")

def outer(origin):
    def inner():
        print("before.")
        origin()
        print("after.")
    return inner

func = outer(func)
func()